
=== SYNOPSIS ===
{{{
#include <xp/sys/utl.h>

int xp_halt (int cmd, int opt);
int xp_halt (int cmd, int opt, xp_time_t tmout, const xp_char_t* msg);
}}}

=== DESCRIPTION ===
'''''xp_halt()''''' reboots, shuts down, or powers off the system. Some features may work on supported platforms only.

'''''cmd''''' is one of the followings:
{{{
XP_HALT_POWEROFF
XP_HALT_RESTART
XP_HALT_SHUTDOWN
}}}

'''''opt''''' is usually zero. On supported platforms, it can be bitwise-or'd with one or more of the followings.
{{{
XP_HALT_FORCE
XP_HALT_TIMED
}}}

When '''''opt''''' is bitwised-or'd with XP_HALT_TIMED, '''''tmout''''' and '''''msg''''' should be specified. '''''tmout''''' is the milliseconds after which the operation will take place. The timed operation can be cancelled with [xp_canceltimedhalt(),xp-sys-utl_canceltimedhalt].

=== RETURN VALUE ===
0 is returned on success while -1 is returned on error.

=== EXAMPLE ===
See [xp_canceltimedhalt(),xp-sys-utl_canceltimedhalt].
